<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <% String contextPath = request.getContextPath(); 
    request.setAttribute("contextPath", contextPath);%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>规则大类统计</title>

    <!-- Bootstrap Core CSS -->
    <link href="${contextPath}/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="${contextPath}/css/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="${contextPath}/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="${contextPath}/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!--common Css-->
    <link href="${contextPath}/css/common.css" rel="stylesheet">
    <link href="${contextPath}/iconfont/iconfont.css" rel="stylesheet">
</head>

<body>

<div id="wrapper">

    <!-- Navigation -->
    <%@include file="nav.jsp"%>

    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h3 class="page-header">规则大类统计</h3>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">
            <div id="container" style="min-width:400px;height:400px"></div>
        </div>
    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->


<!-- jQuery -->
<script src="${contextPath}/js/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="${contextPath}/js/bootstrap.min.js"></script>

<!-- Metis Menu Plugin JavaScript -->
<script src="${contextPath}/js/metisMenu.min.js"></script>


<!-- Custom Theme JavaScript -->
<script src="${contextPath}/js/sb-admin-2.min.js"></script>
<script src="${contextPath}/js/highcharts.js"></script>

<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script>
    $(function () {
        $('#container').highcharts({
            chart: {
                type: 'column'
            },
            title: {
                text: '规则金额统计'
            },
            subtitle: {
                text: ''
            },
            credits:{
                enabled: false,
            },
            xAxis: {
                categories:
                [
	                <%
		               	List<Map<String, String>> list =(List<Map<String, String>>)request.getAttribute("resultDto"); 
		                for(Map<String, String> map:list){
	               	%>
	               	<%="'"+map.get("date")+"',"%>
	                <%
	                }
	                %>
                ],
                crosshair: true
            },
            yAxis: {
                min: 0,
                title: {
                    text: '金额 (元)'
                }
            },
            tooltip: {
                headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y:.2f} 元</b></td></tr>',
                footerFormat: '</table>',
                shared: true,
                useHTML: true
            },
            plotOptions: {
                column: {
                    pointPadding: 0.2,
                    borderWidth: 0
                }
            },
            series: 
			[
				{
	                name: '数字定位玩法',
	                data: 
	                [
	                	<%
		               	List<Map<String, String>> list1 =(List<Map<String, String>>)request.getAttribute("resultDto"); 
						String s1="";
						for(int index=0;index<list1.size();index++){
							
							if(index==list1.size()-1){
								s1+=list1.get(index).get("digitalPositioning");
							}else{
		               			s1+=list1.get(index).get("digitalPositioning")+",";
							}
		                }
						%>
						<%=s1%>
	                ]
	            }, 
				{
	                name: '大小单双玩法',
	                data: 
	                [
	                	<%
		               	List<Map<String, String>> list2 =(List<Map<String, String>>)request.getAttribute("resultDto"); 
						String s2="";
						for(int index=0;index<list2.size();index++){
							
							if(index==list2.size()-1){
								s2+=list2.get(index).get("sizeDanShuang");
							}else{
		               			s2+=list2.get(index).get("sizeDanShuang")+",";
							}
		                }
						%>
						<%=s2%>
	                ]
	            }, 
				{
	                name: '数字组合玩法',
	                data: 
	                [
	                	<%
		               	List<Map<String, String>> list3 =(List<Map<String, String>>)request.getAttribute("resultDto"); 
						String s3="";
						for(int index=0;index<list3.size();index++){
							
							if(index==list3.size()-1){
								s3+=list3.get(index).get("digitalCombination");
							}else{
		               			s3+=list3.get(index).get("digitalCombination")+",";
							}
		                }
						%>
						<%=s3%>
	                ]
	            },
				{
	                name: '数字玩法',
	                data: 
	                [

						<%
			               	List<Map<String, String>> list4 =(List<Map<String, String>>)request.getAttribute("resultDto"); 
							String s4="";
							for(int index=0;index<list4.size();index++){
								
								if(index==list4.size()-1){
									s4+=list4.get(index).get("number");
								}else{
			               			s4+=list4.get(index).get("number")+",";
								}
			                }
						%>
						<%=s4%>
	                ]
	            },
				{
	                name: '猜合玩法',
					data: 
					[
						<%
			               	List<Map<String, String>> list5 =(List<Map<String, String>>)request.getAttribute("resultDto"); 
							String s5="";
							for(int index=0;index<list5.size();index++){
								
								if(index==list5.size()-1){
									s5+=list5.get(index).get("guessGe");
								}else{
			               			s5+=list5.get(index).get("guessGe")+",";
								}
			                }
						%>
						<%=s5%>
					]
	            }
			]
        });
    });

</script>

</body>

</html>
